package com.young.shop.controller;

import com.young.shop.pojo.vo.BaseRespVO;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/remove")
public class RemoveController extends BaseController {
    @Override
    protected void doGet(HttpServletRequest req , HttpServletResponse resp) throws ServletException, IOException {
        //删除session
        req.getSession().removeAttribute("client");

        //向前端发送退出成功的信息
        BaseRespVO baseRespVO = new BaseRespVO();
        baseRespVO.setMsg("退出成功！");
        writerSucccessBaseRespVoToResponse(resp,baseRespVO);
    }
}
